<?php

/**
 * Student form base class.
 *
 * @package    elearning
 * @subpackage form
 * @author     Your name here
 */
class BaseStudentForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'               => new sfWidgetFormInputHidden(),
      'country_id'       => new sfWidgetFormPropelChoice(array('model' => 'Country', 'add_empty' => false)),
      'language_id'      => new sfWidgetFormPropelChoice(array('model' => 'Language', 'add_empty' => false)),
      'std_account_name' => new sfWidgetFormInput(),
      'std_first_name'   => new sfWidgetFormInput(),
      'std_last_name'    => new sfWidgetFormInput(),
      'birthday'         => new sfWidgetFormDate(),
      'std_phone'        => new sfWidgetFormInput(),
      'std_email'        => new sfWidgetFormInput(),
      'std_avatar_image' => new sfWidgetFormInput(),
      'std_password'     => new sfWidgetFormInput(),
      'std_status'       => new sfWidgetFormInput(),
      'std_last_vistit'  => new sfWidgetFormDateTime(),
      'std_credit'       => new sfWidgetFormInput(),
      'created_at'       => new sfWidgetFormDateTime(),
      'updated_at'       => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'               => new sfValidatorPropelChoice(array('model' => 'Student', 'column' => 'id', 'required' => false)),
      'country_id'       => new sfValidatorPropelChoice(array('model' => 'Country', 'column' => 'iso')),
      'language_id'      => new sfValidatorPropelChoice(array('model' => 'Language', 'column' => 'id')),
      'std_account_name' => new sfValidatorString(array('max_length' => 45)),
      'std_first_name'   => new sfValidatorString(array('max_length' => 45)),
      'std_last_name'    => new sfValidatorString(array('max_length' => 45)),
      'birthday'         => new sfValidatorDate(array('required' => false)),
      'std_phone'        => new sfValidatorString(array('max_length' => 45, 'required' => false)),
      'std_email'        => new sfValidatorString(array('max_length' => 255)),
      'std_avatar_image' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'std_password'     => new sfValidatorString(array('max_length' => 45)),
      'std_status'       => new sfValidatorInteger(),
      'std_last_vistit'  => new sfValidatorDateTime(),
      'std_credit'       => new sfValidatorNumber(),
      'created_at'       => new sfValidatorDateTime(array('required' => false)),
      'updated_at'       => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('student[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Student';
  }


}
